package demo_0711;

public class T8_0324 {
        public TreeNode invertTree(TreeNode root) {
            if(root == null) return null;
            reverse(root);
            invertTree(root.left);
            invertTree(root.right);
            return root;
        }
        private void reverse(TreeNode root) {
            if (root == null) return;
            TreeNode tmp = root.left;
            root.left = root.right;
            root.right = tmp;
        }
}
